/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-04-04
 * Time:14:26
 */
public class Text1 {
    public static void test(String name, int sum) throws UserException {
        if (!name.equals("tq02"))
            throw new UserException(name+"用户名错误");
        else if (!(sum==110)) {
            throw new UserException("密码错误");

        }
    }

    public static void main(String[] args) {
        // Text1 text=new Text1();
        try {
            test("tq02", 22);
        } catch (UserException KK) {
            System.out.println("UserException:"+KK.getMessage());
            KK.printStackTrace();
        }
    }
}
